<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../css/style.css" />
    <style>

    </style>
</head>

<body>
    <header class="aui-bar aui-bar-nav aui-bar-light" id="aui-header">
        <a class="aui-btn aui-pull-left" tapmode onclick="closeWin()">
            <span style="color:#81B846;" class="aui-iconfont aui-icon-left"></span>
        </a>
        <div class="aui-title" style="color:#81B846;">批次管理</div>
        <div class="aui-pull-right" style="width:48px;height:48opx;" tapmode onclick="createFarming()">
            <img src="../../image/main/nav_icon_add.png">
        </div>
    </header>
    <div class="aui-tab border-bottom" id="tab">
        <div class="aui-tab-item tab-fixed aui-active">全部农事</div>
        <div class="aui-tab-item tab-fixed">采摘收获</div>
        <div class="aui-tab-item tab-fixed">水肥管理</div>
        <div class="aui-tab-item tab-fixed">病虫防治</div>
        <div class="aui-tab-item tab-fixed">灌溉管理</div>
        <div class="aui-tab-item tab-fixed">其他操作</div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/aui-tab.js"></script>
<script type="text/javascript">
    var tab = new auiTab({
        element: document.getElementById("tab"),
    }, function(ret) {
        api.setFrameGroupIndex({
            name: 'frame_batchManager_group',
            index: ret.index - 1,
            scroll: true
        });
    });
    apiready = function() {
        api.parseTapmode();
        var header = $api.byId('aui-header');
        $api.fixStatusBar(header);
        var headerPos = $api.offset(header);
        var tabbar = $api.byId('tab');
        var tabbarPos = $api.offset(tabbar);
        var body_h = $api.offset($api.dom('body')).h;
        api.openFrameGroup({
            name: 'frame_batchManager_group',
            background: '#f8f8f8',
            scrollEnabled: false,
            rect: {
                x: 0,
                y: headerPos.h + tabbarPos.h,
                w: 'auto',
                h: 'auto'
            },
            frames: [{
                name: 'alias',
                url: './batchManage/allFarming_frm.html',
                bgColor: '#f8f8f8'
            }, {
              name: 'framebatchManager',
              url: './batchManager/framebatchManager_frm.html',
              bgColor: '#f8f8f8'
            },
            {
              name: 'monitor',
              url: './batchManager/monitor_frm.html',
              bgColor: '#f8f8f8'
            },
            {
              name: 'automation',
              url: './batchManager/automation_frm.html',
              bgColor: '#f8f8f8'
            },
            {
              name: 'auto_strategy',
              url: './batchManager/auto_strategy_frm.html',
              bgColor: '#f8f8f8'
            },
            {
              name: 'sec_strategy',
              url: './batchManager/sec_strategy_frm.html',
              bgColor: '#f8f8f8'
            }]
        }, function(ret, err) {
            var index = ret.index;
        });

    };


    function createFarming(){
      api.openWin({
          name: 'createFarming',
          url: './createFarming_win.html'
      });

    }

    function closeWin() {
        api.closeWin({});
    }
</script>

</html>
